/**
 * Created by lenovo on 2016/8/5.
 */
/**
 * Created by lenovo on 2016/8/4.
 */
  AjaxIO.post("/master/block",info,
            function (result) {
        if(result.length!=0){
            var engineer=document.getElementById("father");
            for(var i=0;i<20;i++){
                var block=document.createElement("div");
                var button=document.createElement("div");//按钮
                var remember=document.createElement("input");
                var checkbox=document.createElement("span");
                var left=document.createElement("div");//左边
                var img=document.createElement("img");//图片
                var content=document.createElement("ul");//中间
                var name=document.createElement("li");//姓名
                var cname=document.createElement("label");//姓名
                var e_id=document.createElement("label");//id
                var evaluate=document.createElement("li");//评价
                var gardeis=document.createElement("p");//分数是
                var garde=document.createElement("span");//多少
                var reservation=document.createElement("p");//预约
                var number=document.createElement("span");//数量
                var job=document.createElement("li");//职位
                var cjob=document.createElement("p");//
                var picjob=document.createElement("img");//职位
                var worktime=document.createElement("li"); //工龄
                var picworktime=document.createElement("img"); //工龄
                var nworktime=document.createElement("span");//数量
                var major=document.createElement("li");//主修


                img.setAttribute("src","/img/headpic.jpg");
                picjob.setAttribute("src","/img/job.png");
                picworktime.setAttribute("src","/img/worktime.png");
                remember.setAttribute("type","radio");
                remember.setAttribute("name","onlyone");
                // remember.setAttribute("checked","checked");
                cname.innerHTML=result[i].e_name;
                e_id.innerHTML=result[i].e_id;
                gardeis.innerHTML="评价：";
                garde.innerHTML=result[i].e_garde;
                reservation.innerHTML="预约次数：";
                number.innerHTML=result[i].e_reservation;
                cjob.innerHTML=result[i].e_job;
                nworktime.innerHTML=result[i].e_worktime;
                major.innerHTML=result[i].e_major;

                //添加css
                block.className="block";
                button.className="button";
                remember.className="remember";
                checkbox.className="checkbox";
                e_id.className="e_id";
                left.className="left";
                img.className="image";
                content.className="content_center";
                cname.className="name";
                worktime.className="line";
                picjob.className="smallpic";
                picworktime.className="smallpic";

                //进行拼装
                engineer.appendChild(block);
                block.appendChild(button);
                button.appendChild(remember);
                button.appendChild(checkbox);
                block.appendChild(left);
                block.appendChild(content);
                left.appendChild(img);
                content.appendChild(name);
                name.appendChild(cname);
                name.appendChild(e_id);
                content.appendChild(evaluate);
                evaluate.appendChild(gardeis);
                gardeis.appendChild(garde);
                evaluate.appendChild(reservation);
                reservation.appendChild(number);
                content.appendChild(job);
                job.appendChild(picjob);
                job.appendChild(cjob);
                content.appendChild(worktime);
                worktime.appendChild(picworktime);
                worktime.appendChild(nworktime);
                content.appendChild(major);
            }
        }

        var m_id = 0;
        $("input.remember").change(function(){
            m_id = $(this).parent().parent().find("label.e_id").html();
            $("#e_id").html(m_id);
        });
    }
})
